package com.sunday.boot3.user.center.repository.dao.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sunday.boot3.user.center.repository.dao.UserRoleDao;
import com.sunday.boot3.user.center.repository.entity.Permissions;
import com.sunday.boot3.user.center.repository.entity.UserRole;
import com.sunday.boot3.user.center.repository.mapper.UserRoleMapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Description: 用户角色关系表 数据访问层实现类
 * @author: zsy
 * @Create: 2024/09/20 14:34:16
 */
@Repository
public class UserRoleDaoImpl extends ServiceImpl<UserRoleMapper, UserRole> implements UserRoleDao {

    /**
     * 通过用户ID获取所有权限
     *
     * @param userId
     * @return {@link List< Permissions>}
     */
    @Override
    public List<Permissions> findPermissionsByUserId(Long userId) {
        return baseMapper.findPermissionsByUserId(userId);
    }
}
